

pad = (n)=>
  (n+'').padStart(2,'0')


export hm = =>
  minute = shallowRef '00'
  second = shallowRef '00'
  [time_run, time_pause] = do =>
    n = 0
    interval = undefined
    [
      =>
        interval = setInterval(
          =>
            ++n
            minute.value = pad parseInt(n / 60)
            second.value = pad(n%60)
            return
          1000
        )
        return
      =>
        clearInterval interval
        return
    ]
  [
    minute
    second
    time_run
    time_pause
  ]
